package com.label.Service.Impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.label.Dao.EntityMapper;
import com.label.Dao.TagInfoMapper;
import com.label.Model.Do.Entity;
import com.label.Model.Do.TagInfo;
import com.label.Model.Query.TagInfoQuery;
import com.label.Service.EntityService;
import com.label.Service.TagInfoService;
import com.label.Utils.UserUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TagInfoServiceImpl extends ServiceImpl<TagInfoMapper, TagInfo> implements TagInfoService {

    @Resource
    private TagInfoMapper tagInfoMapper;


    @Override
    public Boolean addTagInfo(TagInfoQuery tagInfoQuery) {
        TagInfo tagInfo= BeanUtil.copyProperties(tagInfoQuery,TagInfo.class);
        tagInfo.setUserId(UserUtil.getUser().getAccount());
        tagInfoMapper.insert(tagInfo);
        return true;
    }
}
